//
//  ViewController.m
//  HQPicCodeProject
//
//  Created by 花强 on 2018/3/16.
//  Copyright © 2018年 花强. All rights reserved.
//

#import "ViewController.h"
#import "HQPicCodeView.h"
#import "HQPicCodeCulculateView.h"

@interface ViewController ()

@property (nonatomic , strong) UILabel * tint;

@end

@implementation ViewController
-(UILabel *)tint{
    if (_tint == nil) {
        _tint = [[UILabel alloc] init];
        [_tint setBackgroundColor:[UIColor lightGrayColor]];
    }
    return _tint;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    HQPicCodeView * view = [[HQPicCodeView alloc] initWithFrame:CGRectMake(100, 200, 80, 30) IsRotation:YES    Block:^(NSString *code) {
        NSLog(@"%@",code);
        self.tint.text = code;
    }];
    
    [view freshVerCode];
    [self.view addSubview:view];
    
    HQPicCodeCulculateView * viewCul = [[HQPicCodeCulculateView alloc] initWithFrame:CGRectMake(100, 400, 80, 30) IsRotation:YES    Block:^(NSString *code) {
        NSLog(@"%@",code);
        self.tint.text = code;
    }];
    
    [viewCul freshVerCode];
    [self.view addSubview:viewCul];
    
    
    [self.tint setFrame:CGRectMake(200, 290, 120, 40)];
    [self.view addSubview:self.tint];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
